%----------------------------------------
% IT IS RECOMMENDED TO USE AUTOLATEX FOR
% COMPILING THIS DOCUMENT.
% http://www.arakhne.org/autolatex
%----------------------------------------

\documentclass[article,english,nodocumentinfo]{multiagentfrreport}

% The TeX code is entering with UTF8
% character encoding (Linux and MacOS standards)
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{../common/sarl-colorized-listing}

\graphicspath{{imgs/auto/},{imgs/},{../common/}}

\declaredocument{VI51 Lab Work \#2}{Environment Model}{UTBM-INFO-VI51-LW2}

\addauthorvalidator*[St\'ephane Galland]{St{\'e}phane}{Galland}{Teacher}

\updateversion{5.0}{\makedate{03}{05}{2015}}{First release on Github}{\upmpublic}

\Set{mafr_contact_name}{\phdname*{St\'ephane}{Galland}}
\Set{mafr_contact_email}{stephane.galland@utbm.fr}
\Set[french]{mafr_contact_phone}{03~84~58~34~18}
\Set[english]{mafr_contact_phone}{+33 384~583~418}

\gdef\skeletonName{\texttt{\mbox{LW2\_VI51\_skeleton\string.jar}}}

\begin{document}

\section{Goal of this Lab Work Session}

The goal of this lab work session is to write a spatial tree for a simulation environment.

You shall learn: 
\begin{itemize}
\item How to write a general API for spatial trees.
\item How to extract information from the tree for the agents.
\item How to apply updates on the tree.
\end{itemize}

\input{../common/install}

\section{Brief Description of the Code Skeleton}

The skeleton contains a framework in the package \texttt{fr.utbm.info.vi51.framework}.
This framework contains the abstract implementation for the execution platform.
\emph{It is recommended to read this code and the associated Javadoc.}

The package \texttt{fr.utbm.info.vi51.labwork2} contains the code to complete during this lab work.

The subpackages are or will be:
\begin{itemize}
\item \texttt{fr.utbm.info.vi51.general.behavior} is the package in which you must create the behaviors (kinematic and/or steering).
\item \texttt{fr.utbm.info.vi51.labwork2.environment} contains the definition of the environment and the objects inside that are specific to the lab work.
\item \texttt{fr.utbm.info.vi51.labwork2.gui} contains the UI for the project.
\item \texttt{fr.utbm.info.vi51.labwork2.agent} contains the code of the agent to complete.
\item The file \texttt{fr/utbm/info/vi51/labwork2/MainProgram.java} contains the main program.
\end{itemize}

\section{Work to be Done during the Lab Work Session}

The following sections describe the work to be done during this lab work session.

\subsection{Tree Implementation}

Write the \code{Tree} and \code{TreeNode} classes.
Each node must contains a shape that represents the covered space.
Each node may contains a list of objects.

\subsection{Perception Iterator}

Write the \code{FrustumIterator} that replies the objects which are stored in a spatial tree and under intersection with a frustum.

\subsection{Include Tree in the WorldModel}

Update the \code{WorldModel} class:
\begin{itemize}
\item Add the tree in the code.
\item Update the \code{onAgenBodyCreated} and \code{onAgentNodyDestroyed} functions.
\item Update the \code{computePerceptionFor} function.
\item Update the \code{applyInfluences} function.
\end{itemize}

\end{document}
